package cn.wolfcode.p2p.base.query;

import cn.wolfcode.p2p.util.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.util.StringUtils;

import java.util.Date;

@Getter@Setter
public class RechargeOfflineQuery extends QueryObject{
        private Long bankInfoId=-1L;
        private String tradeCode;
        @DateTimeFormat(pattern = "yyyy-MM-dd")
        private Date beginDate;
        @DateTimeFormat(pattern = "yyyy-MM-dd")
        private Date endDate;
        private Integer state=-1;
        private Long applierId;

        public Date getEndDate(){
                return DateUtil.getEndDate(endDate);
        }
        public String getTradeCode(){
                return StringUtils.hasLength(tradeCode)?tradeCode:null;
        }
}
